fix(telemetry-ingest): add migration runner for sensor_error_log table#59
Merged
LostPointer merged 2 commits intoDafeCpp:developfrom Apr 22, 2026
Merged
Conversation
…ensor_error_log table The sensor_error_log table was missing from experiment_db, causing UndefinedTableError and 500s on GET /api/v1/sensors/:id/error-log. Migration 005 existed but had no runner or Dockerfile COPY for the telemetry-ingest-service container. - Add bin/migrate.py (same runner pattern as experiment-service) - Copy bin/ and migrations/ in Dockerfile - Add telemetry-ingest-migrate Makefile target (targets experiment_db) - Wire telemetry-ingest-migrate into mvp-demo-check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All three bin/migrate.py files were identical copies. Extracted run_migrate_cli() into backend_common/db/migrations.py; each service's bin/migrate.py is now a 5-line wrapper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/v1/sensors/:id/error-logвозвращал 500 сUndefinedTableError: relation "sensor_error_log" does not existsensor_error_logсоздалась в БДtelemetry_ingest_service, а не вexperiment_db, к которой подключается сервис005_sensor_error_log.sqlсуществовала, но у telemetry-ingest-service не было ни migration runner'а, ниCOPYв DockerfileИзменения:
bin/migrate.py(тот же паттерн, что у experiment-service)DockerfileдобавленыCOPY bin/иCOPY migrations/telemetry-ingest-migrate(применяет миграции вexperiment_db)mvp-demo-checkтеперь зависит отtelemetry-ingest-migrateHotfix в текущем окружении: миграция применена вручную через psql, checksum зарегистрирован в
schema_migrations.Test plan
make dev-clean && make dev-up && make auth-init && make experiment-migrate && make telemetry-ingest-migrate— всё проходит без ошибокGET /api/v1/sensors/:id/error-logвозвращает 200 (с валидным JWT) вместо 500make telemetry-ingest-migrateпечатает "No pending migrations." без ошибок🤖 Generated with Claude Code